﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EtapaVentaListGrid.ascx.cs" 

Inherits="UILGestion.Admin.Etapa.EtapaVentaListGrid" %>
 <script type="text/javascript">
     function SelectAll(frm, id) {

         var frm = document.getElementById("itemPlaceHolderContainer");
         for (i = 1; i < frm.rows.length; i++) {
             var checkbox = frm.rows[i].cells[0].childNodes[1];
             if (checkbox != null)
                 checkbox.checked = document.getElementById(id).checked;
         }
     };
    </script>

<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc1" %>

<asp:Panel runat="server" ID="PanelRecepcion" >
<asp:DataPager ID="pager" PagedControlID="ListView1" runat="server" >
    <Fields>
      <cc1:PagerField NextPageImageUrl="~/Images/arrow_right2.gif" PreviousPageImageUrl="~/images/arrow_left.gif" />
    </Fields>
</asp:DataPager>
<asp:ListView ID="ListView1" runat="server" OnDataBound="ListView1_DataBound" 
    DataKeyNames="idInternal" onitemdatabound="ListView1_ItemDataBound">
    <LayoutTemplate>
        <table id="itemPlaceHolderContainer" border="0" runat="server" class="ms-crm-List-Header">
            <tr id="Tr1" runat="server">
               
                     <th>
                  <asp:CheckBox runat="server" ID="chkSelectAll" ClientIDMode="Static" onclick="SelectAll('ListView1','chkSelectAll')" />
                 </th>       
                <th id="Th2" runat="server">
                    <asp:LinkButton ID="LinkButton1" CommandName="Sort" CommandArgument="nombreVenta" runat="server" ForeColor="Blue">NOMBRE VENTA</asp:LinkButton>
                </th>
                
                  <th id="Th9" runat="server">
                    <asp:LinkButton ID="LinkButton7" CommandName="Sort" CommandArgument="nombreConst" runat="server" ForeColor="Blue">NOMBRE CONSTRUCCION</asp:LinkButton>
                </th>
                 <th id="Th8" runat="server">
                    <asp:LinkButton ID="LinkButton6" CommandName="Sort" CommandArgument="cantidadItem" runat="server" ForeColor="Blue">TOTAL Edif./Bloque</asp:LinkButton>
                </th>
             <%--   <th id="Th4" runat="server">
                    <asp:LinkButton ID="LinkButton5" CommandName="Sort" CommandArgument="cantidadItem" runat="server">Total Piso/Mz</asp:LinkButton>
                </th>
--%>
                 <th id="Th1" runat="server">
                    <asp:LinkButton ID="LinkButton2" CommandName="Sort" CommandArgument="area" runat="server" ForeColor="Blue">AREA</asp:LinkButton>
                </th>

                <th id="Th3" runat="server">
                    <asp:LinkButton ID="LinkButton3" CommandName="Sort" CommandArgument="fechaEntrega" runat="server" ForeColor="Blue">FECHA ENTREGA</asp:LinkButton>
                </th>
                <th id="Th5" runat="server">
                    <asp:LinkButton ID="LinkButton4" CommandName="Sort" CommandArgument="bitActivo" runat="server" ForeColor="Blue">ACTIVO</asp:LinkButton>
                </th>
                 <th id="Th4" runat="server" align="right">
                    <asp:LinkButton ID="LinkButton5" CommandName="Sort" CommandArgument="proyectoStr" runat="server" ForeColor="Blue">PROYECTO</asp:LinkButton>
                </th>
                
                
            </tr>
            <tr id="itemPlaceholder" runat="server">
            </tr>
        </table>



    </LayoutTemplate>
    <ItemTemplate>
        <tr style='background-color: <%# (Container.DataItemIndex % 2 == 0)?"#fff":"#eee" %>'>
         <td>
             <asp:CheckBox runat="server" ID="chkEmployeeSelector"  />
         </td>
           <td width="250px">
               <asp:Hyperlink runat= "server"  ForeColor="Blue"
                Text='<%# DataBinder.Eval(Container.DataItem,"nombreVenta").ToString()%>'  
                 Target="_self"  ID="Hyperlink1"
                NavigateUrl='<%# "~/Admin/Etapa/EtapaVentaReadForm.aspx?id=" + DataBinder.Eval (Container.DataItem,"idInternal").ToString() %>' 
               />   
            </td>
            <td width="150px">
                 <%# Eval("nombreConst")%> <br />
            </td>
            <td  align="right" width="50px">
                 <%# Eval("cantidadItemStr")%> <br />
            </td>
            <%--<td  align="right" width="50px">
                 <%# Eval("cantidadPisoStr")%> <br />
            </td>--%>
             <td  align="right" width="70px">
                 <%# Eval("areaStr")%> <br />
            </td>

             <td >
                 <%# Eval("fechaEntregaStr")%> <br />
            </td>
                         
              <td>
                <input id="Checkbox1" type="checkbox" runat="server" checked= '<%# Eval("bitActivo")%>' disabled="disabled">
               <br />
            </td>
           <td  align="right" width="250px">
                 <%# Eval("proyectoStr")%> <br />
            </td>
             <td width="45px" align="right">
                

                <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                     CommandArgument='<%# Eval("idInternal")%>' ImageUrl="../../Images/delete.gif" 
                     OnClick="Deleteitem" OnClientClick="return confirm('Usted quiere eliminar?')" />
                                        
                 
            </td>

          
        </tr>
    </ItemTemplate>
    <EmptyDataTemplate>
        <table id="Table1" runat="server" >
            <tr>
                <td>
                   <h2 style="font-size: x-small; color: #960818">
                        No existe Informacion.</h2>
                </td>
            </tr>
        </table>
    </EmptyDataTemplate>
</asp:ListView>



</asp:Panel>

    
     